<template>
  <div :id="dyid" style="width: 700px; height: 450px"></div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  props: {
    dyid:String,
    datas: Object,
  },
  data() {
    return {
      options:{},
      charts: "",
    };
  },
  mounted() {
    this.options = this.datas
    this.charts=echarts.init(document.getElementById(this.dyid))
    this.charts.setOption(this.options)
  },
  watch:{
      datas:{
          handler(nd){
              this.options=nd
              // this.charts=echarts.init(document.getElementById('radia'))
              this.charts.setOption(this.options)
          },
          deep:true
      }
  }
};
</script>

<style>
</style>